package main

import "fmt"

var aa = 3	// 包内变量
var ss = "kkk"

//bb := true 包内变量需要使用var定义

var (
	cc = 4
	dd = "jjj"
)

func variableZeroValue() {
	var a int
	var b string
	fmt.Println(a, b)
	fmt.Printf("%d %q\n", a, b) // %q打印字符串的引号
}

func variableInitialValue() {
	var a, b int = 3, 4
	var s string = "abc"
	fmt.Println(a, b, s)
}

func variableTypeDeduction() {
	var a, b, c, s = 3, 4, true, "def"
	fmt.Println(a, b, c, s)
}

func variableShorter() {
	a, b, c, s := 3, 4, true, "def"
	b = 5
	fmt.Println(a, b, c, s)
}

func main() {
	fmt.Println("Hello world")
	variableZeroValue()
	variableInitialValue()
	variableTypeDeduction()
	variableShorter()
	fmt.Println(aa, ss, cc, dd)
}
